/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package app.algo;

/**
 *
 * @author bharat
 */

class CvPoint2D64f {
	public double x;
	public double y;
}

class FeatureData{
	public int r;
        public int c;
        public int octv;
        public int intvl;
        public double subintvl;
        public double scl_octv;
}

public class SiftFeature {
	public double x;                      /**< x coord */
	public double y;                      /**< y coord */
	public int descriptorLength;          /**< descriptor length */
	public double descriptor[];             /**< descriptor */
	public double scale;                    /**< scale of a Lowe-style feature */
	public double orientation;                    /**< orientation of a Lowe-style feature */
	public FeatureData featureData;
	public CvPoint2D64f locationInImage;
	public CvPoint2D64f locationInModel;

	public SiftFeature forwaredMatch;
        public SiftFeature backwardMatch ;

	public static double descr_dist_sq( SiftFeature f1, SiftFeature f2 )
	{
		double diff, dsq = 0;
		double descr1[], descr2[];
		int i, d;

		d = f1.descriptorLength;
		if( f2.descriptorLength != d )
			return Double.MAX_VALUE;
		descr1 = f1.descriptor;
		descr2 = f2.descriptor;

		for( i = 0; i < d; i++ )
		{
			diff = descr1[i] - descr2[i];
			dsq += diff*diff;
		}
		return dsq;
	}
}
